﻿using System.Collections.Generic;
using System.Linq;

namespace UniSender
{
    public class CampaignAggregateStats
    {
        public virtual int Total { get; set; }
        
        public virtual IDictionary<MessageStatus, int> Data { get; set; }

        public CampaignAggregateStats()
        { }

        public CampaignAggregateStats(Native.CampaignAggregateStats native)
        {
            Total = native.total;
            if (native.data != null)
                Data = native.data.ToDictionary(
                    item => Utility.ParseEnum<MessageStatus>(item.Key),
                    item => item.Value
                );
        }
    }
}
